
<button class="btn btn-primary" (click)="addNews()">添加</button>

<table class="table">
  <thead>
  <tr>
    <th scope="col">#</th>
    <th scope="col">标题</th>
    <th scope="col">作者</th>
    <th scope="col">发布时间</th>
    <!--<td scope="col">内容</td>-->
    <td>操作</td>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let n of nl ;  index as i">
    <th scope="row">{{i+1}}</th>
    <td>{{n.title}}</td>
    <td>{{n.author}}</td>
    <td>{{n.pbdate | date:'yyyy-MM-dd HH:mm'}}</td>
    <!--<td>{{n.content}}</td>-->
    <td>
      <button class="btn btn-success" (click)="updateNews(n.newsid)">修改</button>
      <button class="btn btn-danger" (click)="deleteNews(n.newsid)" >删除</button>
    </td>
  </tr>

  </tbody>
</table>

<p-paginator [rows]="pagesize" [totalRecords]="total" (onPageChange)="onPageChange($event)"></p-paginator>
